# coding: utf-8
#--------------------#
# Coder  : Dzlua
# Email  : 505544956@qq.com
# module : scheduler
# file   : config.py
# Time   : 2017/09/29
#--------------------#
import datetime, time

#--------------------#
# state
DBPS_NONE             = 0
DBPS_START            = 100
DBPS_OK               = 200
DBPS_FAILED           = 300
DBPS_FAILED_UNPACK    = 310
DBPS_FAILED_OPEN_LIB  = 321
DBPS_FAILED_CLOSE_LIB = 322
DBPS_FAILED_COPY_LIB  = 323

#
DBPS_FIND = DBPS_NONE

#--------------------#
# database
DB_SHOW_INFO = False
DB_HOST      = 'localhost'
DB_USER      = 'yanhui'
DB_PASSWORD  = 'yanhui'
DB_DATABASE  = 'wordpress'
#
DB_POSTS              = 'wp_posts'
DB_TERM_TAXONOMY      = 'wp_term_taxonomy'
DB_TERM_RELATIONSHIPS = 'wp_term_relationships'
DB_PKGS               = 'wp_userfilelib'
DB_USERS              = 'wp_users'
DB_TERMS              = 'wp_terms'

#--------------------#
# thread pool
TP_THREAD_NUM = 4

#--------------------#
# scheduler
SCHED_SHOW_INFO  = True
SCHED_POSTS_TIME = {
    'trigger': 'interval',
    'minutes': 60
    }
SCHED_PKGS_TIME = {
    'trigger': 'interval',
    'minutes': 5
    }
SCHED_ITBASE_TIME = {
    'trigger': 'interval',
    'minutes': 60
    }
SCHED_UNUSE_PKGS_TIME = {
    #'trigger': 'date',
    #'run_date': datetime.datetime.now(),
    'trigger': 'interval',
    #'days': 1
    'minutes': 5
}

#--------------------#
# cole make
CM_BIN                   = '/cole2/colemake'
CM_USING_PKGS_PATH       = '/disk2/coledata/colelib/it/pkgs'
CM_USING_POSTS_PATH      = '/disk2/coledata/colelib/it/posts'
CM_USING_ITBASE_PATH     = '/disk2/coledata/config/itlib'
CM_PKGS_PKGS_PATH        = '/disk2/apachedata/uploads/pkgs/'
#
CM_POSTS_LIB_PATH        = '/disk2/scheduler/libs/posts'
CM_PKGS_LIB_PATH         = '/disk2/scheduler/libs/pkgs'
CM_ITBASE_LIB_PATH       = '/disk2/scheduler/libs/itbase'
CM_PKGS_UNPACK_PATH      = '/disk2/scheduler/unpkgs/'

#--------------------#
PROTS_HOST = '127.0.0.1'
PROTS_PORT = 1508
#--------------------#
